<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=0,maximum-scale=1.0" />
		<script src="http://g.tbcdn.cn/mtb/lib-flexible/0.3.4/??flexible_css.js,flexible.js"></script>
		<link rel="stylesheet" type="text/css" href="css/reset.css"/>
		<link rel="stylesheet" type="text/css" href="css/style.css"/>
		<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/public.js" type="text/javascript" charset="utf-8"></script>
		<title>会员中心</title>
	</head>
	<body>
		<div id="vipcon">
			<div class="userCon">
				<img class="userIcon" src=""/>
				<span class="userName"></span>
				<img class="go_back" onclick="go_back()" src="images/go_back.png"/>
			</div>
			<div class="vipList">
				<a href="coupon.html" class="list">
					<img class="icon" src="images/yhq.png"/>
					优惠券
				</a>
				<a href="order.html" class="list">
					<img class="icon" src="images/wddd.png"/>
					我的订单
				</a>
				<a href="javascript:void(0)" class="list">
					<img class="icon" src="images/lxkf.png"/>
					联系客服
				</a>
			</div>
		</div>
<script type="text/javascript">
	 $(function () {
        (function ($) {
            $.getUrlParam = function (name) {
                var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
                var r = window.location.search.substr(1).match(reg);
                if (r != null) return unescape(r[2]);
                return null;
            }
        })
        (jQuery);
        $(".znum").html($.getUrlParam('znum'));
        $(".pnum").html($.getUrlParam('pnum'));
        znum=$(".znum").html();
        pnum=$(".pnum").html();
        getUserinfo();
    })
	 
	 //获取个人信息
	 function getUserinfo(){
	 	$.ajax({
            url:url() + "index.php/Api/Index/getUserInfo",
            dataType:"json",
            type:"get",
            success:function (data){
            	if(data.state==2){
            		console.log(data.data)
            		$('.userIcon').attr('src',data.data.headimgurl);
            		$('.userName').text(data.data.nickname)
            	}
                
            }
        })
	 }
	 //返回上层
	 function go_back(){
	 	history.go(-1)
	 }
</script>
	</body>
</html>
